var mongoose = require('mongoose')
var Schema = mongoose.Schema

//岗位表
var jobSchema = new Schema({
    "address": String,
    "cfyid": String,
    "cfytype": String,
    "city": String,
    "createdAt": String,
    "date": Array,
    "detail": String,
    "district": String,
    "edu": String,
    "gender": String,
    "info": Array,
    "jobcfy": Array,
    "jobname": String,
    "lnglat": Array,
    // "_id": "60a374bb5b51982eaf9c717f",
    "province": String,
    "salary": Number,
    "time": Array,
    "updatedAt": String
})
var jobModel = mongoose.model('jobModel',jobSchema)


//用户表
var userSchema = new Schema({
  username:String,
  password:String,
  avatar:String,
  gender:String,
  age:Number
})
var userModel = mongoose.model('userModel',userSchema)


//岗位分类
var cateSchema = new Schema({
  "name": String,
  "icon": String,
  "catetype": String
})
var cateModel = mongoose.model('cateModel',cateSchema)

//岗位报名
var joinSchema = new Schema({
  userId:String,
  jobId:String,
  status:Number,
  jobname:String,
  salary:String,
  address:String,
  district:String
})
var joinModel = mongoose.model('joinModel',joinSchema)

module.exports = {
  jobModel,
  userModel,
  cateModel,
  joinModel
}